//
// Copyright (c) 2009-2011, chunquedong
//
// This file is part of ChunMap project
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
//
// History:
//   2011-05-03  Jed Young  Creation
//

using chunmapView
using chunmapModel
using fwt
using gfx

**
** ExtentCommand
**
@Js
class ExtentCommand : CCommand
{
  private Envelope oldEnvelope
  private Envelope envelope

  new make(MapCanvas map, Envelope envelope) : super(map)
  {
    this.envelope = envelope
    oldEnvelope = map.view.getViewEnvelope
  }

  override Void redo()
  {
    map.view.setViewEnvelope(envelope)
  }

  override Void undo()
  {
    map.view.setViewEnvelope(oldEnvelope)
  }

}

